package cn.lycode.system.domain.dto.syspost;

import cn.lycode.common.utils.SecurityUtils;
import cn.lycode.system.domain.entity.SysPost;
import lombok.Data;

import java.util.Date;

/**
 * SysPost添加DTO
 *
 * @since 2024-09-03
 * @author lyCode
 */
@Data
public class SysPostAddDTO {

    private String postCode; //岗位编码
    private String postName; //岗位名称
    private Long sort; //显示顺序
    private String remark; //备注

    public SysPost buildAddEntity() {
        SysPost sysPost = new SysPost();
        sysPost.setPostCode(this.postCode);
        sysPost.setPostName(this.postName);
        sysPost.setSort(this.sort);
        sysPost.setRemark(this.remark);
        sysPost.setCreateTime(new Date());
        sysPost.setCreateBy(SecurityUtils.getLoginUsername());
        return sysPost;
    }
}

